package com.wmlive.hhvideo.heihei.discovery.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.wmlive.hhvideo.common.base.DcBaseFragment;
import com.wmlive.hhvideo.heihei.beans.subject.TopicInfo;
import com.wmlive.hhvideo.heihei.discovery.fragment.SearchMusicFragment;
import com.wmlive.hhvideo.heihei.discovery.fragment.SearchVideoFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lsq on 6/13/2017.
 * 搜索音乐页面的ViewPagerAdapter
 */

public class SearchMusicViewPagerAdapter extends FragmentPagerAdapter {

    private List<DcBaseFragment> fragments;

    public SearchMusicViewPagerAdapter(FragmentManager fm, String startType, TopicInfo topicInfo) {
        super(fm);
        fragments = new ArrayList<>();
        fragments.add(SearchVideoFragment.newInstance(startType, topicInfo));
        fragments.add(SearchMusicFragment.newInstance(startType, topicInfo));
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

}
